<template>
  <div class="win-quick-modal">
    <div class="win-bar">
      <div class="start">
        <span>
          <em></em>
          <em></em>
          <em></em>
        </span>
        开始
      </div>
      <ul class="win-quick">
        <li>
          <span>
            <em class="wos-user-icon">
              <i class="iconfont wos-user" />
            </em>
          </span>
          <em>用户</em>
        </li>
        <li>
          <span><i class="iconfont wos-document" /></span>
          <em>文档</em>
        </li>
        <li>
          <span><i class="iconfont wos-picture" /></span>
          <em>图片</em>
        </li>
        <li @click.stop="handleSetting">
          <span><i class="iconfont wos-setting" /></span>
          <em>设置</em>
        </li>
        <li>
          <span><i class="iconfont wos-power" /></span>
          <em>电源</em>
        </li>
      </ul>
    </div>
    <div class="quick-content"></div>
  </div>
</template>

<script setup lang="ts">
import { useCreateTask } from '@/hooks/runningTaskHooks'

const { handleCreateTask } = useCreateTask()

const emits = defineEmits(['close'])

const handleSetting = async () => {
  emits('close')
  handleCreateTask('setting')
}
</script>

<style scoped lang="scss">
@import '@/assets/scss/mixin';

.win-quick-modal {
  position: relative;
  width: 648px;
  min-width: 648px;
  height: 50vh;
  color: var(--task-bar-color);
  backdrop-filter: blur(50px);
  background-color: var(--task-bar-bg-color);

  .win-bar {
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 0;
    width: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition:
      width 0.3s,
      box-shadow 0.3s;

    &:hover {
      width: 258px;
      box-shadow: 10px 0 10px 0 rgba(0, 0, 0, 0.1);
      transition:
        width 0.3s 0.5s,
        box-shadow 0.3s 0.5s;
    }

    .start {
      height: 48px;
      display: flex;
      align-items: center;
      white-space: nowrap;
      font-size: 16px;

      &:hover {
        @include hover-model;
      }

      > span {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 48px;
        min-width: 48px;

        em {
          display: inline-block;
          width: 18px;
          height: 1px;
          background-color: #fff;
          margin-bottom: 4px;

          &:last-of-type {
            margin-bottom: 0;
          }
        }
      }
    }

    .win-quick {
      li {
        display: flex;
        align-items: center;
        white-space: nowrap;
        font-size: 16px;

        &:hover {
          @include hover-model;
        }

        span {
          display: inline-flex;
          justify-content: center;
          align-items: center;
          width: 48px;
          min-width: 48px;
          height: 48px;
          font-size: 16px;

          .wos-user-icon {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 20px;
            height: 20px;
            border-radius: 10px;
            background-color: rgb(102, 102, 102);

            .wos-user {
              font-size: 10px;
              transform: scale(0.75);
              transform-origin: center center;
            }
          }
        }
      }
    }
  }

  .quick-content {
    padding-left: 48px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
  }
}
</style>
